package cn.com.dcsgo.library.client.controller;


import cn.com.dcsgo.library.client.domain.vo.BorrowRecordVO;
import cn.com.dcsgo.library.client.response.ResponseResult;
import cn.com.dcsgo.library.client.service.IBorrowRecordsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 借阅相关接口
 *
 * @author Dcsgo
 * @since 2024-09-02
 */
@RestController
@RequestMapping("/borrowRecords")
@Api(tags = "借阅相关接口")
@RequiredArgsConstructor
@Slf4j
public class BorrowRecordsController {
    private final IBorrowRecordsService borrowRecordsService;

    @GetMapping()
    @ApiOperation("获取借阅记录")
    public ResponseResult<List<BorrowRecordVO>> queryBorrowRecords(Long userId) {
        return ResponseResult.success(borrowRecordsService.queryBorrowRecordsByUserId(userId));
    }
}
